package cn.taobaoke.restful.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * Accounts类.
 * +-----------------------------------------------------------------------------------------------+
 * |类名称: AccountsEntity                                                                         |
 * |创建时间: 5/31/17                                                                               |
 * |功能简介:                                                                                       |
 * |参考链接:                                                                                       |
 * +-----------------------------------------------------------------------------------------------+
 *
 * @author luch
 */
@Setter
@Getter
@ToString
@Entity
@Table(name = "tb_accounts")
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"})
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AccountsEntity implements Serializable {

    @Id
    @GeneratedValue
    private Long id;

    @Column
    private Long agentId;

    @Column
    private Boolean isAdmin;

    @Column
    private String date;             // format: 'yyyy-MM'

    @Column
    private Double income;           // 结算收入

    @Column
    private Double realAccount;     // 实际结算

    @Column
    private Boolean isPayed;        // 是否支付过

    @Column
    private Date createAt;

    @Column
    private Date updateAt;

//    @Column
//    private Long domainId;

    @Transient
    private AgentEntity agent;
}
